package com.hemerasolutions.v2trainer.util.primefaces;

import javax.faces.component.UIComponent;

import org.primefaces.component.api.DynamicColumn;
import org.primefaces.component.celleditor.CellEditor;
import org.primefaces.component.columns.Columns;

public class CustomDynamicColumn extends DynamicColumn {

	private CellEditor cellEditor = null;
	
	public CustomDynamicColumn(int index, Columns columns) {
		super(index, columns);
	}

	
	
	
@Override
	public CellEditor getCellEditor(){
	    if(cellEditor == null) {
        	this.applyModel();	            	
	    	for(UIComponent child : getChildren()) {
	            if(child instanceof CellEditor)
	                cellEditor = (CellEditor) child;
	        }
	    }
	
	    return cellEditor;	
	}
	
}
